package com.jingogo.service.impl;

import com.jingogo.entity.GoldPrice;
import com.jingogo.mapper.GoldPriceMapper;
import com.jingogo.service.GoldPriceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;

@Service
public class GoldPriceServiceImpl implements GoldPriceService {
    @Autowired
    private GoldPriceMapper goldPriceMapper;

    @Override
    public void addPrice(GoldPrice price) {
        goldPriceMapper.insert(price);
    }

    @Override
    public List<GoldPrice> getRealtimePrice() {
        return goldPriceMapper.selectRealtime();
    }

    @Override
    public List<GoldPrice> getHistoryPrice(Date start, Date end) {
        return goldPriceMapper.selectHistory(start, end);
    }
} 